home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume8 / se / part04 < prev    next >
Encoding:
Internet Message Format  |  1987-01-25  |  43.8 KB

  1. Subject:  v08i004:  Georgia Tech 'se' Screen Editor
  2. Newsgroups: mod.sources
  3. Approved: mirror!rs
  4.  
  5. Submitted by: emoryu1!arnold (Arnold D. Robbins)
  6. Mod.sources: Volume 8, Issue 4
  7. Archive-name: se/Part04
  8.  
  9.  
  10. Here is the second release of the Georgia Tech Screen Editor, 'se'.
  11. There were enough changes that a whole new posting is warranted.
  12.  
  13. Major Changes:
  14.     All Georgia Tech specific stuff removed.
  15.     It understands window size changes on 4.3BSD and ATT Unix PC/3B1
  16.     Support for the shared library on the ATT Unix PC/3B1
  17.     Considerable source code reorganization in certain files.
  18.  
  19. Enjoy,
  20.  
  21. Arnold Robbins
  22.  
  23. #! /bin/sh
  24. # This is a shell archive, meaning:
  25. # 1. Remove everything above the #! /bin/sh line.
  26. # 2. Save the resulting text in a file.
  27. # 3. Execute the file with /bin/sh (not csh) to create the files:
  28. #    se.m4
  29. export PATH; PATH=/bin:$PATH
  30. echo shar: extracting "'se.m4'" '(43823 characters)'
  31. if test -f 'se.m4'
  32. then
  33.     echo shar: will not over-write existing file "'se.m4'"
  34. else
  35. cat << \SHAR_EOF > 'se.m4'
  36. .\" 
  37. .\" $Header: se.m4,v 1.6 86/11/12 11:34:49 arnold Exp $
  38. .\" 
  39. .\" $Log:    se.m4,v $
  40. .\" Revision 1.6  86/11/12  11:34:49  arnold
  41. .\" Fixed use of `BSD'. Changed discussion of windows. ADR.
  42. .\" 
  43. .\" Revision 1.5  86/09/19  12:14:12  arnold
  44. .\" Typo fix.
  45. .\" 
  46. .\" Revision 1.4  86/07/17  17:52:34  arnold
  47. .\" Added discussion of windowing systems, and AUTHORS section.
  48. .\" 
  49. .\" Revision 1.3  86/07/11  15:17:50  osadr
  50. .\" Removal of Georgia Tech specific items, and some cleaning up.
  51. .\" 
  52. .\" Revision 1.2  86/05/27  17:50:37  osadr
  53. .\" Fix to quote an m4 keyword which was getting deleted.
  54. .\" 
  55. .\" Revision 1.1  86/05/06  13:41:04  osadr
  56. .\" Initial revision
  57. .\" 
  58. .\" 
  59. .\" 
  60. .ie t \{ .de CW
  61. .vs 10.5p
  62. .ta 16m/3u 32m/3u 48m/3u 64m/3u 80m/3u 96m/3u
  63. .nf
  64. .ft CW
  65. .cs CW 18
  66. .. \}
  67. .el \{ .de CW
  68. .nf
  69. .ft B
  70. .. \}
  71. .ie t \{ .de CN
  72. .ta 0.5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i
  73. .vs
  74. .fi
  75. .cs CW
  76. .ft
  77. .. \}
  78. .el \{ .de CN
  79. .fi
  80. .ft
  81. .. \}
  82. changequote([])
  83. .if n .ds lq ""
  84. .if n .ds rq ""
  85. .if t .ds lq ``
  86. .if t .ds rq ''
  87. changequote
  88. .TH SE 1 local
  89. .SH NAME
  90. se \- screen editor
  91. .SH SYNOPSIS
  92. .B se
  93. ifelse(HARD_TERMS,YES,
  94. [
  95. .B \-t
  96. .I term
  97. ],)
  98. [
  99. .B \-\-acdfghiklmstuvwxyz
  100. ] [ file ... ]
  101. .SH DESCRIPTION
  102. .I Se
  103. is a screen oriented version of
  104. .IR ed (1).
  105. It accepts the same      
  106. commands with a few differences.
  107. .PP
  108. ifelse(HARD_TERMS,YES,,`divert(-1)')
  109. .I Se
  110. must be run from a CRT terminal and must be told what sort
  111. of terminal it is; hence the
  112. .I term
  113. parameter.  The terminals
  114. currently supported are:
  115. .CW
  116.     adds980   bee200   haz1510  sol      vi200
  117.     adds100   cg       hp21     trs80    vi50
  118.     adm31     esprit   ibm      ts1
  119.     adm3a     fox      isc8001  tvi950
  120.     anp       gt40     netron   tvt
  121.     bee150    h19      sbee     vc4404
  122. .CN
  123. If no terminal type is specified
  124. .I se
  125. looks to see if you have the shell variable \*(lqTERM\*(rq set; if so,
  126. .I se
  127. recognizes that value as
  128. your terminal type.
  129. ifelse(HARD_TERMS,YES,`divert(-1)',divert)
  130. .I Se
  131. must be run from a CRT terminal.
  132. It uses the
  133. .IR ifelse(S5R2,YES,curses (3X),termlib (3))
  134. terminal operations library, which
  135. retrieves terminal capabilities from the
  136. .B ifelse(S5R2,YES, /usr/lib/terminfo, /etc/termcap)
  137. database.
  138. For
  139. .I se
  140. to function, all of the following must be true:
  141. .IP 1.
  142. You must have the environment variable \*(lqTERM\*(rq set
  143. to the name of your terminal type.
  144. .IP 2.
  145. The
  146. .B ifelse(S5R2,YES, /usr/lib/terminfo, /etc/termcap)
  147. database
  148. must be accessible, and contain an entry for your terminal;
  149. or the
  150. ifelse(S5R2,YES,`\*`('lqTERMINFO\*`('rq',`\*`('lqTERMCAP\*`('rq')
  151. environment variable must contain a description for your terminal.
  152. (See
  153. .IR ifelse(S5R2,YES, curses (3X), termlib (3))
  154. for details.)
  155. .IP 3.
  156. Your terminal must have the capability to do cursor motion.
  157. ifelse(HARD_TERMS,YES,divert,)
  158. .PP
  159. .I Se
  160. first
  161. clears the screen,
  162. draws in its margins,
  163. and executes the commands in the file
  164. .BR ./.serc ,
  165. or failing that,
  166. .BR $HOME/.serc ,
  167. if either file exists.
  168. It then processes the command line,
  169. obeying the options given there, and begins
  170. reading your file (if you specified one).  The screen it draws
  171. looks something like this.
  172. (The parenthesized numerals are not part of the screen layout,
  173. but are there to aid in the following discussion.)
  174. .PP
  175. .CW
  176.     \fR(1) (2)              (3)\fP
  177.     A     |
  178.     B     |#include <stdio.h>
  179.     C     |
  180.     D    *|   register int i;
  181.     E     |
  182.     .  -> |   for (i = 1; i <= 12; i++)
  183.     G     |      putc ('\en', stderr);
  184.     $     |
  185.     cmd>  |_  \fR(4)\fP
  186.     11:39   myfile ........................  \fR(5)\fP
  187. .CN
  188. .PP
  189. The display is divided into five parts:
  190. (1) the line number area,
  191. (2) the mark name area,
  192. (3) the text area,
  193. (4) the command line, and
  194. (5) the status line.
  195. The current line
  196. is indicated by the symbol \*(lq.\*(rq in the
  197. line number area of the screen.
  198. In addition, a rocket
  199. .if n (\*(lq\fB->\fP\*(rq)
  200. .if t (\*(lq\f(CW->\fP\*(rq)
  201. is displayed to make the current line
  202. more obvious.  The current mark name of each line is shown in the
  203. markname area just to the left of the vertical bar.
  204. Other information, such as the
  205. number of lines read in, the name of the file, and the time of day, are
  206. displayed in the status line.
  207. .PP
  208. The cursor is positioned at the beginning of the command
  209. line, showing you that
  210. .I se
  211. awaits your command.  You may now enter any of the standard
  212. .I ed
  213. commands and 
  214. .I se
  215. will perform them, while making sure that
  216. the current line is always displayed on the screen.
  217. .PP
  218. You can set
  219. options to control the behavior of 
  220. .I se
  221. on the command line, simply by using a \*(lq\-\*(rq, followed by
  222. the option letter, and any parameters that the option may take.
  223. These options can also be set after invoking
  224. .I se
  225. with the options command, \*(lqo\*(rq, explained in detail in the section
  226. on commands. Here is a summary:
  227. .sp
  228. .nf
  229.     opt = a | c | d[\fIdir\fP] | f | g | h | i[\fIa\fP | \fIindent\fP] |
  230.         k | l[\fIlop\fP] | lm[\fIcol\fP] | m | s[\fIfiletype\fP] |
  231.             t[\fItabs\fP] | u[\fIchar\fP] | v[\fIcol\fP] | w[\fIcol\fP] |
  232.             x | y[\fIkey\fP] | z | -[\fIlnr\fP]
  233. .fi
  234. .sp
  235. There are only a few other things that you need know to
  236. successfully use
  237. .IR se :
  238. .IP 1.
  239. If you make an error, 
  240. .I se
  241. automatically displays an error message in
  242. the status line.  It also leaves
  243. your command line intact so that you may change it using
  244. in-line editing commands (see the \*(lqv\*(rq command).
  245. If you don't want to bother with changing the command, just hit
  246. .SM DEL
  247. to erase the command.
  248. .IP 2.
  249. The \*(lqp\*(rq command has a different meaning than in
  250. .IR ed .
  251. When used with line
  252. numbers, it displays as many of the lines
  253. in the specified range as possible (always including the last line).
  254. When used without line numbers, \*(lqp\*(rq displays  the
  255. previous page.
  256. .IP 3.
  257. The \*(lq:\*(rq command positions a specified line at the
  258. top of the screen (e.g., \*(lq12:\*(rq positions the screen so that
  259. line 12 is at the top).  If no line number is specified, \*(lq:\*(rq
  260. displays the next page.
  261. .PP
  262. Keeping these few differences in mind, you will see that
  263. .I se
  264. can perform all of the
  265. functions of
  266. .IR ed ,
  267. while giving the advantage of a \*(lqwindow\*(rq into
  268. the edit buffer.
  269. .PP
  270. Below is a summary of line number expressions, regular expressions
  271. and commands.
  272. Where there is no difference between
  273. .IR se " and " ed
  274. no explanation is given.
  275. .SS "Line Number Expressions"
  276. .PP
  277. .TP
  278. .I n
  279. .IR n th
  280. line.
  281. .TP
  282. \&.
  283. current line.
  284. .TP
  285. $
  286. last line.
  287. .TP
  288. ^
  289. previous line.
  290. .TP
  291. \-
  292. previous line.
  293. .TP 
  294. .RI "capital letter " A
  295. .IR A th
  296. line on the screen.
  297. .I Se
  298. has a number of features that take advantage of the window
  299. display to minimize keystrokes and speed editing.
  300. In the line number area of the screen,
  301. .I se
  302. displays a capital letter
  303. for each line, but in \*(lqabsolute line number\*(rq mode (controlled by the
  304. \*(lqoa\*(rq command; see the options command)
  305. .I se
  306. displays the actual line number of each line.
  307. .TP
  308. #
  309. number of the first line on the screen.
  310. .TP
  311. .RI / "regular expression" [/]
  312. next line with pattern.
  313. .TP
  314. .RI ? "regular expression" [?]
  315. previous line with pattern.
  316. .TP
  317. >name
  318. number of the next line having the given markname
  319. (search wraps around, like //).
  320. .TP
  321. <name
  322. number of the previous line having the given markname
  323. (search proceeds in reverse, like ??).
  324. .TP
  325. .I expression
  326. any of the above operands may be combined with plus
  327. or minus signs to produce a line number expression.  Plus
  328. signs may be omitted if desired (e.g., /parse/\-5, /lexical/+2,
  329. /lexical/2, $\-5, .+6, .6).
  330. Unlike
  331. .IR ed , " se"
  332. does not recognize trailing \*(lq+\*(rq or \*(lq\-\*(rq signs.  They must always
  333. be followed by a integer.  Successive \*(lq+\*(rq or \*(lq\-\*(rq signs
  334. (e.g. \*(lq\-\-\*(rq) are also not allowed.
  335. However, like
  336. .IR vi (1), " se"
  337. will allow you to leave off the trailing delimiter in
  338. forward searches, backward searches, in the substitute command,
  339. the join command,
  340. and in the transliteration command.
  341. .SS "Regular Expression Notation"
  342. .PP
  343. .TP
  344. ^
  345. beginning of line if first character in regular expression.
  346. .TP
  347. \&.
  348. any single character other than newline.
  349. .TP
  350. $
  351. end of line if last character in regular expression.
  352. .TP
  353. .RI [ ccl "] [^" ccl ]
  354. character set.
  355. .TP
  356. *
  357. 0 or more matches of the preceding regular expression element.
  358. .TP
  359. \e
  360. ignore special meaning of the immediately following character
  361. except \*(lq\e(\*(rq and \*(lq\e)\*(rq.
  362. .TP                 
  363. .RI \e( "regular expression" \e)
  364. Tags the text actually matched by the sub-pattern
  365. specified by
  366. .I "regular expression"
  367. for use in the replacement part
  368. of a substitute
  369. command.                          
  370. .TP
  371. &
  372. Appearing in the replacement part of a substitute command, represents
  373. the text actually matched by the pattern part of the command.
  374. .TP
  375. %
  376. Appearing as
  377. the only character in the replacement part,
  378. represents the replacement part used in the previous substitute command.
  379. (This allows an empty replacement pattern as well.)
  380. If there are other characters in the replacement part along with the
  381. \*(lq%\*(rq, the \*(lq%\*(rq is left alone.
  382. .TP
  383. .RI \e digit
  384. Appearing in the replacement part of a substitute command,
  385. represents the text actually matched by the tagged sub-pattern
  386. specified by
  387. .IR digit .
  388. .SS File names
  389. .PP
  390. .I Se
  391. will expand environment variables which appear anywhere in
  392. a path name. Identifiers in a path name are treated as
  393. environment variables if they start with a dollar sign \*(lq$\*(rq.
  394. A real \*(lq$\*(rq can be used if it is escaped.
  395. If the named environment variable is not found, it is
  396. deleted from the path name.
  397. The expanded path name will be placed in the status line.
  398. .SS The .serc File
  399. .PP
  400. When
  401. .I se
  402. starts up, it tries to open the file
  403. .B .serc
  404. in your current directory.
  405. If that file cannot be found, it will attempt to open the file
  406. .B .serc
  407. in your home directory.
  408. If either file exists,
  409. .I se
  410. will read it, one line at a time, and execute each line as a command.
  411. If a line has a \*(lq#\*(rq as the
  412. .I first
  413. character on the line, or if the line is empty,
  414. the entire line is treated as a comment,
  415. otherwise it is executed.
  416. Here is a sample
  417. .B .serc
  418. file:
  419. .PP
  420. .CW
  421.     # turn on tabs every 8 columns, auto indent
  422.     ot+8
  423.     oia
  424. .CN
  425. .PP
  426. The
  427. .B .serc
  428. file is useful for setting up personalized options,
  429. without having to type them on the command line every time, and without
  430. using a special shell file in your bin (for
  431. .IR sh (1))ifelse(BSD,YES,`,'
  432. or a special alias (for
  433. .IR csh (1))).
  434. .PP
  435. Command line options are processed
  436. .I after
  437. commands in the
  438. .B .serc
  439. file, so, in effect, command line options can be used to over-ride the
  440. defaults in your
  441. .B .serc
  442. file.
  443. .PP
  444. .BR NOTE :
  445. Commands in the
  446. .B .serc
  447. file do
  448. .I not
  449. go through that part of
  450. .I se
  451. which processes the special control characters (see below), so
  452. .I do not
  453. use them in your
  454. .B .serc
  455. file.
  456. .PP
  457. .B Commands
  458. .PP
  459. .TP
  460. (.)\^a\^[:text]  Append
  461. If the command is followed immediately by a colon, then
  462. whatever text follows the colon is inserted without entering
  463. \*(lqappend\*(rq mode.
  464. .TP
  465. (.,.)\^c\^[:text]  Change
  466. If the command is followed immediately by a colon, then
  467. whatever text follows the colon is inserted in place of the named lines
  468. without entering \*(lqappend\*(rq mode.
  469. .TP
  470. (.,.)\^d  Delete
  471. .TP
  472. e\^[\*(lq!\*(rq\^|\^\*(lqx\*(rq] [filename]  Enter
  473. \*(lqe!\*(rq, enter now, is the same as \*(lqE\*(rq in
  474. .IR ed .
  475. \*(lqex\*(rq enters the file with \*(lqXTABS\*(rq turned on, i.e. expand any tabs to
  476. blanks.  File names with extensions \*(lqs\*(rq, \*(lqc\*(rq, \*(lqh\*(rq, \*(lqf\*(rq and \*(lqr\*(rq, are
  477. automatically entered with \*(lqXTABS\*(rq turned on.
  478. .TP
  479. f [filename]  File
  480. .TP
  481. (.,$)\^g/\fIreg expr\fP/command  Global on pattern
  482. .TP
  483. none h\^[stuff] Help
  484. This command provides access to on-line documentation on
  485. the screen editor.
  486. \*(lqStuff\*(rq may be used to select which information is displayed.
  487. The help command will display information which is correct
  488. for both UNIX and SWT modes.
  489. .TP
  490. (.)\^i\^[:text]  Insert
  491. If the command is immediately followed by a colon, then
  492. whatever text follows is inserted without entering \*(lqappend\*(rq mode.
  493. The current line pointer is left at the last line inserted.
  494. .TP
  495. (^,.)\^j\^[\^/stuff\^[\^/\^]\^]     Join
  496. Join is basically the same in
  497. .IR se " and " ed
  498. except if no line numbers are specified, the default
  499. is to join the previous line with the current line (as opposed
  500. to the current line and the next line), and
  501. .I se
  502. allows you to indicate what is to replace the newline(s) in \*(lqstuff\*(rq.
  503. The default is a single blank.  If you do specify \*(lqstuff\*(rq, the trailing
  504. delimiter is optional. \*(lqj/\*(rq is considered the same as \*(lqj//\*(rq,
  505. i.e., the newline is deleted.
  506. .TP
  507. (.,.)\^k\^[m]   marK
  508. .I Se
  509. allows marks to be any
  510. single character other than a newline. If \*(lqm\*(rq is not
  511. present, the lines are marked with the default name of blank.
  512. .RI ( Ed
  513. allows only lower case letters to be marks.)
  514. .TP
  515. none  l  Locate
  516. The Locate command places the system name into the status line
  517. (e.g. \*(lqgatech\*(rq or \*(lqemory\*(rq).
  518. This is so that one
  519. can tell what machine he is using from within the screen
  520. editor. This is particularly useful for installations with
  521. many machines that can run the editor, where the user can
  522. switch back and forth between them, and become confused as
  523. to where he is at a given moment.
  524. .TP
  525. .RI (.,.)\^m\^ line
  526. Move
  527. .TP
  528. (.,.)\^n\^[m]  Name
  529. If \*(lqm\*(rq is present, the last line in the
  530. specified range is marked with it and all other lines having that
  531. mark name are given the default mark name of blank.
  532. If \*(lqm\*(rq is not
  533. present,
  534. the names of all lines in the range are cleared.
  535. .TP
  536. none  o\^[stuff]  Option
  537. Editing options may be queried or set.  \*(lqStuff\*(rq determines which
  538. options are affected.
  539. Options for 
  540. .I se
  541. can be specified in three ways;
  542. in the
  543. .B .serc
  544. file, on the command line that invokes
  545. .IR se ,
  546. or with the \*(lqo\*(rq command.
  547. To specify an option
  548. with the \*(lqo\*(rq command, just enter \*(lqo\*(rq followed immediately by
  549. the option letter and its parameters.  To specify an option on the
  550. command line, just use \*(lq\-\*(rq followed by the option letter and its
  551. parameters.
  552. With this second method, if there are imbedded spaces in the parameter
  553. list, the entire option should be enclosed in quotes.  For
  554. example, to specify the \*(lqa\*(rq (absolute line number) option
  555. and tab stops at column 8 and every fourth thereafter with the
  556. \*(lqo\*(rq command, just enter
  557. .sp
  558. .CW
  559.     oa
  560.     ot 8 +4
  561. .CN
  562. .sp
  563. when
  564. .I se
  565. is waiting for a command.
  566. To enter the same options on the invoking command line, you might
  567. use
  568. .sp
  569. .CW
  570.     se myfile -a "-t 8 +4"
  571. .CN
  572. .sp
  573. You may also choose to put options that you will always want into
  574. your
  575. .B .serc
  576. file.  Commands in the
  577. .B .serc
  578. file should look exactly the same
  579. as they would if they were typed at the
  580. .I se
  581. command line.
  582. Command line options will always over-ride option
  583. commands given in your
  584. .B .serc
  585. file.
  586. .sp
  587. The following summarizes the available
  588. .I se
  589. options:
  590. .RS
  591. .TP
  592. a
  593. causes absolute line numbers to be displayed in the line number area
  594. of the screen. The default behavior is to display upper-case letters
  595. with the letter \*(lqA\*(rq corresponding to the first line in the window.
  596. .TP
  597. c
  598. inverts the case of all letters you type (i.e., converts
  599. upper-case to lower-case and vice versa). This option causes
  600. commands to be recognized only in upper-case and alphabetic line
  601. numbers to be displayed and recognized only in lower-case.
  602. In this mode,
  603. .I se
  604. displays the line number letters in lower case
  605. and expects its command letters in upper case.  Unshifted letters
  606. from the terminal are converted to upper case and shifted
  607. letters to lower case.
  608. .TP
  609. .RI d\^[ dir ]
  610. selects the placement of the current line pointer following
  611. a \*(lqd\*(rq (delete) command.
  612. .I Dir
  613. must be either \*(lq>\*(rq or \*(lq<\*(rq.
  614. If \*(lq>\*(rq is specified, the default behavior is
  615. selected: the line following the deleted lines becomes the new
  616. current line.  If \*(lq<\*(rq is specified, the line immediately preceding
  617. the deleted lines becomes the new current line.  If neither is
  618. specified, the current value of
  619. .I dir
  620. is displayed in the status line.
  621. .TP
  622. f
  623. selects Fortran oriented options. This is equivalent to specifying
  624. the \*(lqot7 +3\*(rq option, and \*(lqXTABS\*(rq is turned on (i.e.
  625. tabs are expanded).
  626. .TP
  627. g
  628. controls the behavior of the \*(lqs\*(rq (substitute) command
  629. when it is under the control of a \*(lqg\*(rq (global) command.
  630. Initially, if a substitute inside a global command fails,
  631. .I se
  632. will not continue with the rest of the lines which might succeed.
  633. If \*(lqog\*(rq is given, then the global substitute will continue, and lines
  634. which failed will not be affected.
  635. Successive \*(lqog\*(rq commands will toggle this behavior.
  636. An explanatory message is placed in the status line.
  637. .TP
  638. h
  639. controls the use of hardware line insert/delete
  640. on terminals that have that capability.
  641. By default, line insert/delete will be used if available.
  642. It is occasionally useful to turn this option off when using the
  643. editor on a terminal which can't keep up, or if the communications
  644. lines may be scrambling the control characters.
  645. Each successive \*(lqoh\*(rq merely toggles a switch within the editor.
  646. An explanatory message is placed in the status line.
  647. .TP
  648. .RI "i\^[ a | " indent " ]"
  649. selects indent value for lines inserted with
  650. \*(lqa\*(rq, \*(lqc\*(rq and \*(lqi\*(rq commands
  651. (initially 1).
  652. \*(lqa\*(rq selects auto-indent which sets the indent to the value which
  653. equals the indent of the previous line.
  654. If neither \*(lqa\*(rq nor
  655. .I indent
  656. are specified,
  657. the current indent value is displayed in the status line.
  658. .TP
  659. k
  660. indicates whether the current contents of your edit buffer
  661. have been saved or not by printing either a \*(lqsaved\*(rq or
  662. \*(lqnot saved\*(rq message on your status line.
  663. .TP
  664. .RI l\^[ lop ]
  665. sets the line number display option.
  666. Under control of this option, 
  667. .I se
  668. continuously displays
  669. the value of one of three symbolic line numbers.
  670. .I lop
  671. may be \*(lq.\*(rq, \*(lq#\*(rq, or \*(lq$\*(rq.
  672. If
  673. .I lop
  674. is omitted, the line number display is disabled.
  675. .TP
  676. .RI lm\^[ col ]
  677. sets the left margin to
  678. .I col
  679. which must be a positive integer.
  680. This option will `shift' your entire screen to the left,
  681. enabling you to see characters at the end of the line that
  682. were previously off the screen; the characters in columns
  683. 1 through
  684. .I col
  685. \- 1 will not be visible.  You may continue
  686. editing in the normal fashion.  To reset your screen enter
  687. the command \*(lqolm 1\*(rq.
  688. If
  689. .I col
  690. is omitted, the current left margin column
  691. is displayed in the status line.
  692. .TP
  693. m
  694. controls notification of
  695. the presence of existing mail
  696. and/or
  697. the arrival of new mail
  698. in the user's mail file. 
  699. The mail file is taken from the \*(lqMAIL\*(rq variable in the user's
  700. environment.
  701. On startup, if the mail file is not empty,
  702. .I se
  703. will remark,
  704. \*(lqYou have mail.\*(rq
  705. Then, if new mail arrives,
  706. .I se
  707. will remark,
  708. \*(lqYou have new mail,\*(rq
  709. and ring the terminal's bell.
  710. The \*(lqm\*(rq option simply toggles a notification switch, so that
  711. the user can turn off this notification.
  712. The \*(lqom\*(rq command displays the current setting of the notify
  713. switch in the status line.
  714. .TP
  715. s\^[d | data | as | s | c | h | n | nr | nroff | p | r | f]
  716. sets other options for case, tabs, etc., for
  717. data files, \*(lqd\*(rq or \*(lqdata\*(rq,
  718. assembly files, \*(lqas\*(rq or \*(lqs\*(rq,
  719. C files, \*(lqc\*(rq,
  720. `include' files, \*(lqh\*(rq,
  721. nroff files, \*(lqn\*(rq or \*(lqnr\*(rq or \*(lqnroff\*(rq,
  722. ratfor files, \*(lqr\*(rq,
  723. pascal files, \*(lqp\*(rq,
  724. and fortran files, \*(lqf\*(rq.
  725. Options set for data and nroff files are \*(lqow74\*(rq and \*(lqot+4\*(rq;
  726. for assembly files \*(lqot 17+8\*(rq and \*(lqXTABS\*(rq is turned on;
  727. for C, `include', pascal and ratfor files
  728. \*(lqow74\*(rq, \*(lqot+4\*(rq and \*(lqXTABS\*(rq is turned on;
  729. for fortran files
  730. \*(lqot 7+3\*(rq and \*(lqXTABS\*(rq is turned on.
  731. If \*(lqXTABS\*(rq is turned on then tabs are expanded.
  732. If no argument is specified the options effected by this
  733. command revert to their default value.
  734. .TP
  735. .RI t\^[ tabs ]
  736. sets tab stops according to
  737. .IR tabs .
  738. .I Tabs
  739. consists of
  740. a series of numbers indicating columns in which tab stops
  741. are to be set.  If a number is preceded by a plus sign (\*(lq+\*(rq),
  742. it indicates that the number is an increment; stops are set
  743. at regular intervals separated by that many columns, beginning with
  744. the most recently specified absolute column number.  If no such
  745. number precedes the first increment specification, the stops are
  746. set relative to column 1.
  747. By default, tab stops are set in every third column starting with
  748. column 1, corresponding to a
  749. .I tabs
  750. specification of \*(lq+3\*(rq.
  751. If
  752. .I tabs
  753. is omitted, the current tab spacing is
  754. displayed in the status line. Examples
  755. .sp
  756. .CW
  757.     ot 1 4 7 10 13 16 19 22 25 28 31 34  ...
  758.     ot +3
  759.     ot 7 +3
  760. .CN
  761. .sp
  762. Once the tab stops are set, the control-i and control-e keys
  763. can be used to move the cursor from its current position forward or
  764. backward to the nearest stop, respectively.
  765. .TP
  766. .RI u\^[ chr ]
  767. Normally,
  768. .I se
  769. displays a non-printing character (e.g. \s-1NEWLINE\s+1, \s-1TAB\s+1 ...)
  770. as a blank.
  771. With this option, you can
  772. select the character that
  773. .I se
  774. displays in place of 
  775. unprintable characters.
  776. .I Chr
  777. may be any printable character.
  778. If
  779. .I chr
  780. is omitted,
  781. .I se
  782. displays the current replacement character on the status line.
  783. Non-printing characters (such as
  784. .I se
  785. control characters), or any others for that matter,
  786. may be entered by hitting the
  787. .SM ESC
  788. key followed immediately by the
  789. key to generate the desired character.
  790. Note, however, that the character you type is taken literally,
  791. exactly as it is generated by your terminal, so case conversion
  792. does not apply.
  793. .TP
  794. .RI v\^[ col ]
  795. sets the default \*(lqoverlay column\*(rq.  This is the column
  796. at which the cursor is initially positioned by the \*(lqv\*(rq command.
  797. .I Col
  798. must be a positive integer, or a dollar sign ($) to indicate
  799. the end of the line.  If
  800. .I col
  801. is omitted, the current overlay
  802. column is displayed in the status line.
  803. .TP
  804. .RI w\^[ col ]
  805. sets the \*(lqwarning threshold\*(rq to
  806. .I col
  807. which must be
  808. a positive integer. Whenever the cursor is  positioned at or
  809. beyond this column, the column number is displayed in the status
  810. line and the terminal's bell is sounded.
  811. If
  812. .I col
  813. is omitted, the current warning threshold is displayed
  814. in the status line.
  815. The default warning threshold is 74, corresponding to the first column
  816. beyond the right edge of the screen on an 80 column crt.
  817. .TP
  818. x
  819. toggles tab compression and expansion (\*(lqXTABS\*(rq).
  820. If XTABS is off, \*(lqox\*(rq
  821. turns it on for subsequent \*(lqr\*(rq,
  822. and \*(lqw\*(rq, commands.
  823. Be aware that the \*(lqe\*(rq
  824. command checks the source option for files;
  825. use the \*(lqex\*(rq command to force
  826. tab expansion.
  827. .TP
  828. .RI y\^[ key ]
  829. allows you to edit encrypted files. \*(lqoy\*(rq followed by a key
  830. will cause the
  831. \*(lqe\*(rq, \*(lqr\*(rq, and \*(lqw\*(rq
  832. commands to encrypt and decrypt files using
  833. .IR crypt (1).
  834. \*(lqoy\*(rq by itself will toggle the current encryption setting.
  835. If there is no current key,
  836. .I se
  837. will ask you for one.
  838. Echoing is turned off while you type your key in, and
  839. .I se
  840. asks you to type it in twice, just to be sure.
  841. If encryption is turned on, and you type a plain \*(lqoy\*(rq,
  842. it will be turned off.
  843. Note that doing so causes
  844. .I se
  845. to forget the value of the encryption key.
  846. Encryption in indicated by the message
  847. \*(lqENCRYPT\*(rq in the status line.
  848. The key is
  849. .I never
  850. shown on your screen.
  851. .TP
  852. z
  853. suspends the editor (puts it in the background)
  854. and returns to the user's shell.
  855. (It has to be a shell that understands Berkeley job control,
  856. or else you'll be in trouble.)
  857. The editor will warn you if the edit buffer has not been saved.
  858. This is the
  859. .I only
  860. way to suspend the editor; the editor uses control-z for its own purposes
  861. (see the section on control characters, below).
  862. If you normally run
  863. .B /bin/sh
  864. without job control,
  865. this command has no effect at all.
  866. .sp
  867. On
  868. .SM UNIX
  869. systems without the Berkeley job control mechanism, this option
  870. will be recognized, but will have no effect.
  871. Instead, an explanatory message will be placed in the status line.
  872. .TP
  873. .RI \-[ lnr ]
  874. splits the screen at the line specified by
  875. .I lnr
  876. which must
  877. be a simple line number within the current window.  All lines above
  878. .I lnr
  879. remain frozen on the screen, the line specified by
  880. .I lnr
  881. is replaced by a row of dashes, and the space below this row becomes
  882. the new window on the file. Further editing commands do not affect the
  883. lines displayed in the top part of the screen.  If
  884. .I lnr
  885. is omitted, the screen is restored to its full size.
  886. .RE
  887. .TP
  888. (.,.)\^p  Print
  889. Prints all the lines in the given range.
  890. As much as possible of the range is displayed, always
  891. including the last line; if no range is given, the previous
  892. page is displayed.
  893. The current line pointer is left at the last line printed.
  894. .TP
  895. q\^[!]  Quit
  896. \*(lqq!\*(rq, exit immediately, is the same as \*(lqQ\*(rq in 
  897. .IR ed .
  898. .TP
  899. (.)r\^[x] [filename]  Read
  900. If no line number is specified, the named file is read starting after current
  901. line (as opposed to
  902. .I ed
  903. where the file is read at the end of the edit buffer).
  904. \*(lqrx\*(rq causes tabs to be expanded in the lines read.
  905. .TP
  906. .RI "(.,.)\^s\^[\^/" "reg expr" / sub "\^[/]\^[g]\^[p]]     Substitute"
  907. If no pattern and replacement are specified after the \*(lqs\*(rq,
  908. .I se
  909. will behave as if you had typed \*(lqs//%/\*(rq, i.e. for the
  910. saved search pattern, substitute the saved replacement pattern.
  911. To just delete a pattern, you may type \*(lqs/stuff\*(rq, and
  912. .I se
  913. will behave as if you had typed \*(lqs/stuff//\*(rq.
  914. .TP
  915. (.,.)t<n>   Copy
  916. (\*(lqTo\*(rq is the
  917. .I ed
  918. mnemonic).
  919. .TP
  920. u\^[d]  Undo
  921. \*(lqu\*(rq undoes the effects of the previous command, on the
  922. .I last line
  923. affected (for instance a substitute command).
  924. \*(lqud\*(rq undoes the last delete, i.e. it inserts the last deleted line
  925. after the current line.
  926. .I Se
  927. does not have a global undo capability.
  928. .TP
  929. (.,.)\^v   oVerlay \(em screen oriented editing
  930. Full screen editing with
  931. .I se
  932. is accomplished through the
  933. use of control characters for editing functions.
  934. With screen oriented editing,
  935. control characters may
  936. be used to modify text anywhere in the buffer.
  937. A control-v
  938. may be used to quit overlay mode.
  939. A control-f
  940. may be used to restore the current line to its original state and
  941. terminate the command.
  942. Since
  943. .I se
  944. supports such a large number of
  945. control functions, the mnemonic value of control character
  946. assignments has dwindled to almost zero.  About the only thing
  947. mnemonic is that most symmetric functions
  948. have been assigned to opposing keys on the keyboard  (e.g.,
  949. forward and backward tab to control-i and control-e, forward
  950. and backward space to control-g and control-h, skip right
  951. and left to control-o and control-w, and so on).
  952. We feel pangs of conscience about this, but can find no
  953. more satisfactory alternative.
  954. If you feel the control character assignments are terrible and
  955. you can find a better way, you may change them by modifying
  956. the definitions in
  957. .I se
  958. and recompiling.
  959. .sp
  960. Except for a few special purpose ones, control characters
  961. can be used anywhere, even on the command line.  (This is why
  962. erroneous commands are not erased \(em you may want to edit
  963. them.)  Most of the functions work on a single line,
  964. but the cursor may be
  965. positioned anywhere in the buffer.
  966. Refer to the next section which describes each control character
  967. in detail.
  968. .TP
  969. (1,$)\^w\^[+ | > | !] [filename]  Write
  970. Write the portion of the buffer specified
  971. to the named file.
  972. If \*(lq+\*(rq or \*(lq>\*(rq is given, the portion of the
  973. buffer is appended to the file; otherwise the portion of
  974. the buffer replaces the file.
  975. \*(lqw!\*(rq, write immediately, is the same as \*(lqW\*(rq in
  976. .IR ed .
  977. .TP
  978. .RI "(1,$)\^x\^/" "reg expr" "/command     eXclude on pattern"
  979. .TP
  980. (.,.)\^y\^[\^/from/to\^[/]\^[p]]  TranslYterate (sic)
  981. The range of characters
  982. specified by \*(lqfrom\*(rq is transliterated into the range of
  983. characters specified by \*(lqto\*(rq. The last line on which something
  984. was transliterated is printed if the \*(lqp\*(rq option is used.
  985. The last line in the range becomes the new current line.
  986. As with the substitute and join commands, and pattern searches, the
  987. trailing delimiter is optional.
  988. .I Se
  989. saves both the \*(lqfrom\*(rq and \*(lqto\*(rq parts of the transliterate command:
  990. \*(lqy\*(rq is the same as \*(lqy//%/\*(rq, i.e. transliterate the saved \*(lqfrom\*(rq range
  991. into the saved \*(lqto\*(rq range.
  992. The \*(lq%\*(rq is special only if it is the only character
  993. in the \*(lqto\*(rq part of the command.
  994. .TP
  995. .RI (.,.)\^zb\^\fIleft\fP\^[,\fIright\fP]\^[\fIchar\fP]  Draw Box
  996. A box is drawn on the given lines, in the given columns,
  997. using the given
  998. .IR char .
  999. This command can be used as an aid for preparing block diagrams,
  1000. flowcharts, or tables.
  1001. .sp
  1002. Line numbers are used to specify top and bottom row positions of the box.
  1003. .IR Left " and " right
  1004. specify left and right column positions of the box.
  1005. If second line number is omitted, the box degenerates to a horizontal line.
  1006. If right-hand column is omitted, the box degenerates to a vertical line.
  1007. If
  1008. .I char
  1009. is omitted, it defaults to blank,
  1010. allowing erasure of a previously-drawn box.
  1011. .sp
  1012. For example, \*(lq1,10zb15,25*\*(rq would draw a box 10 lines high
  1013. and 11 columns across, using asterisks.
  1014. The upper left corner of the box would be on line 1, column 15,
  1015. and the lower right corner on line 10, column 25.
  1016. .TP
  1017. (.)\^=  Equals what line number?
  1018. .TP
  1019. (1,$)\^~m\^command  global exclude on markname
  1020. Similar to the \*(lqx\*(rq prefix except that
  1021. \*(lqcommand\*(rq is performed for all lines in the range that do not have the
  1022. mark name \*(lqm\*(rq.
  1023. .TP
  1024. changequote([])
  1025. (1,$)\^'m\^command  global on markname
  1026. changequote
  1027. Similar to the \*(lqg\*(rq prefix except that
  1028. \*(lqcommand\*(rq is performed for all lines in the range that have the
  1029. mark name \*(lqm\*(rq.
  1030. .TP
  1031. (.)\^:   display next page
  1032. The next page of the
  1033. buffer is displayed and the current line pointer is placed at
  1034. the top of the window.
  1035. .TP
  1036. changequote({})
  1037. .RI "none ![" "\s-1UNIX\s+1 command" "]   escape to the shell"
  1038. The user's choice of shell is taken from the \*(lqSHELL\*(rq environment
  1039. variable (if it exists),
  1040. and is used to execute
  1041. .I "\s-1UNIX\s+1 command"
  1042. if it is present. Otherwise, an
  1043. interactive shell is created.
  1044. After an interactive shell exits, the screen is immediately redrawn.
  1045. If a command was run, the results are left on the screen, and the
  1046. user must type
  1047. .SM RETURN
  1048. to redraw the editing window.
  1049. This is how
  1050. .IR vi (1)
  1051. behaves.
  1052. If the first character of the
  1053. .I "\s-1UNIX\s+1 command"
  1054. is a `!', then the `!' is replaced with the text of
  1055. the previous shell command.
  1056. An unescaped `%' in the
  1057. .I "\s-1UNIX\s+1 command"
  1058. will be replaced with the current
  1059. saved file name.
  1060. If the shell command is expanded,
  1061. .I se
  1062. will echo it first, and then execute it.
  1063. This behavior is identical to the version of
  1064. changequote
  1065. .I ed
  1066. in
  1067. .SM UNIX
  1068. System V.
  1069. .SS Control Characters
  1070. .PP
  1071. The set of control characters defined below can be used for correcting
  1072. mistakes while typing regular editing commands, for correcting commands
  1073. that have caused an error message to be displayed, for correcting lines
  1074. typed in append mode, or for in-line editing using the \*(lqv\*(rq command.
  1075. .TP
  1076. control-a
  1077. Toggle insert mode.  The status of the insertion indicator
  1078. is inverted.
  1079. Insert mode, when enabled, causes the characters you type to be
  1080. inserted at the current cursor position in the line
  1081. instead of overwriting the characters that were there
  1082. previously.  When insert mode is in effect, \*(lqINSERT\*(rq appears
  1083. in the status line.
  1084. .TP
  1085. control-b
  1086. Scan right and erase.  The current line is scanned from the current
  1087. cursor position to the right margin until an occurrence of the
  1088. next character typed is found.  When the character is found, all
  1089. characters from the current cursor position up to (but not including)
  1090. the scanned character are deleted and the remainder of the line
  1091. is moved to the left to close the gap.  The cursor is left in
  1092. the same column which is now occupied by the scanned character.
  1093. If the line to the right of the cursor does not contain the character
  1094. being sought, the terminal's bell is sounded.
  1095. .I Se
  1096. remembers the last character that was scanned using this
  1097. or any of the other scanning keys;
  1098. if control-b is hit twice in a row, this remembered character is
  1099. used instead of a literal control-b.
  1100. .TP
  1101. control-c
  1102. Insert blank.  The characters at and to the right of
  1103. the current cursor position are moved to the right one column
  1104. and a blank is inserted to fill the gap.
  1105. .TP
  1106. control-d
  1107. Cursor up.  The effect of this key depends on
  1108. .IR se 's
  1109. current mode.  When in command mode, the current line pointer is moved
  1110. to the previous line without affecting the contents of the command
  1111. line.  If the current line pointer is at line 1, the last line
  1112. in the file becomes the new current line.
  1113. In overlay mode (viz. the \*(lqv\*(rq command), the cursor is
  1114. moved up one line while remaining in the same column.
  1115. In append mode, this key is ignored.
  1116. .TP
  1117. control-e
  1118. Tab left.  The cursor is moved to the nearest tab stop
  1119. to the left of its current position.
  1120. .TP
  1121. control-f
  1122. \*(lqFunny\*(rq return.  The effect of this key depends on the
  1123. editor's current mode. In command mode, the current command line is
  1124. entered as\-is, but is not erased upon completion of the
  1125. command; in append mode, the current line is duplicated; in
  1126. overlay mode (viz. the \*(lqv\*(rq command), the current line is restored
  1127. to its original state and command mode is reentered (except if
  1128. under control of a global prefix).
  1129. .TP
  1130. control-g
  1131. Cursor right.  The cursor is moved one column to the right.
  1132. .TP
  1133. control-h
  1134. Cursor left.  The cursor is moved one column to the left.
  1135. Note that this
  1136. .I does not
  1137. erase any characters; it simply moves the cursor.
  1138. .TP
  1139. control-i
  1140. Tab right.
  1141. The cursor is moved to the next tab stop to the right of its current
  1142. position.
  1143. Again, no characters are erased.
  1144. .TP
  1145. control-k
  1146. Cursor down.  As with the control-d key, this key's effect depends
  1147. on the current editing mode.  In command mode,  the current line pointer
  1148. is moved to the next line without changing the contents of the command
  1149. line. If the current line pointer is at the last line in the file,
  1150. line 1 becomes the new current line.  In overlay mode (viz. the
  1151. \*(lqv\*(rq command), the cursor is moved down one line while remaining in the
  1152. same column.  In append mode, control-k has no effect.
  1153. .TP
  1154. control-l
  1155. Scan left.  The cursor is positioned according to the character
  1156. typed immediately after the control-l.  In effect, the current line is
  1157. scanned, starting from the current cursor position and moving left,
  1158. for the first occurrence of this character.  If none is found before
  1159. the beginning of the line is reached, the scan resumes with the
  1160. last character in the line.  If the line does not contain the character
  1161. being looked for, the message \*(lqNOT FOUND\*(rq is printed in the status line.
  1162. .I Se
  1163. remembers the last character
  1164. that was scanned for using this key; if the control-l is hit twice in
  1165. a row, this remembered character is searched for instead of a literal
  1166. control-l.
  1167. Apart from this, however, the character typed after control-l is taken
  1168. literally, so
  1169. .IR se 's
  1170. case conversion feature does not apply.
  1171. .TP
  1172. control-m
  1173. Kill right and terminate; identical to the
  1174. .SM NEWLINE
  1175. key described below.
  1176. .TP
  1177. control-n
  1178. Scan left and erase.
  1179. The current line is scanned from the current cursor position to the
  1180. left margin until an occurrence of the next character typed is found.
  1181. Then that character and all characters to its right up to
  1182. (but not including) the character under the cursor are erased.
  1183. The remainder of the line, as well as the cursor are moved to the
  1184. left to close the gap.  If the line to the left of the cursor
  1185. does not contain the character being sought, the terminal's bell is
  1186. sounded.
  1187. If control-n is hit twice in a row, the last character scanned for is
  1188. used instead of a literal control-n.
  1189. .TP
  1190. control-o
  1191. Skip right.  The cursor is moved to the first position beyond
  1192. the current end of line.
  1193. .TP
  1194. control-p
  1195. Interrupt.  If executing any command except \*(lqa\*(rq, \*(lqc\*(rq, \*(lqi\*(rq or
  1196. \*(lqv\*(rq,
  1197. .I se
  1198. aborts the command and reenters command mode.  The command
  1199. line is not erased.
  1200. This is the only way to interrupt the editor.
  1201. .I Se
  1202. ignores the
  1203. .SM SIGQUIT
  1204. signal (see
  1205. .IR signal (2));
  1206. in fact it disables generating
  1207. quits from the terminal.  The editor uses
  1208. .SM "ASCII FS"
  1209. (control-\e) for its
  1210. own purposes, and changes the terminal driver to make control-p be the
  1211. interrupt character.
  1212. .TP
  1213. control-]
  1214. Fix screen.
  1215. The screen is reconstructed from
  1216. .IR se 's
  1217. internal representation of the screen.
  1218. .TP
  1219. control-r
  1220. Erase right.  The character at the current cursor position
  1221. is erased and
  1222. all characters to its right are moved left one position.
  1223. .TP
  1224. control-j
  1225. Scan right.  This key is identical to the control-l key
  1226. described above, except that the scan proceeds to the right from
  1227. the current cursor position.
  1228. .TP
  1229. control-t
  1230. Kill right.  The character at the current cursor position
  1231. and all those to its right are erased.
  1232. .TP
  1233. control-u
  1234. Erase left.  The character to the left of the current cursor
  1235. position is deleted and all characters to its right are moved
  1236. to the left to fill the gap.  The cursor is also moved left one
  1237. column, leaving it over the same character.
  1238. .TP
  1239. control-v
  1240. Skip right and terminate. The cursor is moved to the current
  1241. end of line and the line is terminated.
  1242. .TP
  1243. control-w
  1244. Skip left.  The cursor is positioned at column 1.
  1245. .TP
  1246. control-x
  1247. Insert tab.  The character under the cursor is moved
  1248. right to the next tab stop; the gap is filled with blanks.
  1249. The cursor is not moved.
  1250. .TP
  1251. control-y
  1252. Kill left.  All characters to the left of the cursor are
  1253. erased; those at and to the right of the cursor are moved
  1254. to the left to fill the void.  The cursor is left in column 1.
  1255. .TP
  1256. control-z
  1257. Toggle case conversion mode.  The status of the case conversion
  1258. indicator is inverted; if case inversion was on, it is turned off,
  1259. and vice versa.
  1260. Case inversion, when in effect, causes all upper case letters to
  1261. be converted to lower case, and all lower case letters to be
  1262. converted to upper case (just like the alpha-lock key on some terminals).
  1263. You can type control-z at any time
  1264. to toggle the case conversion mode.  When case inversion is in effect,
  1265. .I se
  1266. displays the word \*(lqCASE\*(rq in the status line.
  1267. Note that
  1268. .I se 
  1269. continues
  1270. to recognize alphabetic line numbers in upper case only, in contrast
  1271. to the \*(lqcase inversion\*(rq option (see the description of options under the
  1272. option command).
  1273. ifelse(BSD,NO,`divert(-1)',)
  1274. .sp
  1275. Also note that when running shell that understands Berkeley job control,
  1276. the only way to
  1277. suspend (stop) the editor is with the \*(lqoz\*(rq command
  1278. (see the options command, \*(lqoz\*(rq, above).
  1279. ifelse(BSD,NO,divert,)
  1280. .TP
  1281. control-_ (\s-1US\s+1)
  1282. Insert newline.  A newline character is inserted before
  1283. the current cursor position, and the cursor is moved one position
  1284. to the right.  The newline is displayed according to the current
  1285. non-printing replacement character (see the \*(lqu\*(rq option).
  1286. .TP
  1287. control-\e (\s-1FS\s+1)
  1288. Tab left and erase.
  1289. Characters are erased starting with the character at the nearest tab
  1290. stop to the left of the cursor up to but not including             
  1291. the character under the cursor.  The rest of the line,
  1292. including the cursor, is moved to the left to close the gap.
  1293. .sp
  1294. Use control-p to interrupt the editor.
  1295. .TP
  1296. control-^ (control-~, \s-1RS\s+1)
  1297. Tab right and erase.
  1298. Characters are erased starting with the character under the cursor
  1299. up to but not including the character at the nearest tab stop to
  1300. the right of the cursor.  The rest of the line is then
  1301. shifted to the left to close the gap.
  1302. .TP
  1303. .SM NEWLINE
  1304. Kill right and terminate.
  1305. The characters at and to the right of the current cursor
  1306. position are deleted, and the line is terminated.
  1307. .TP
  1308. .SM DEL
  1309. Kill all.  The entire line is erased, along with any error
  1310. message that appears in the status line.
  1311. .TP
  1312. .SM ESC
  1313. Escape.  The
  1314. .SM ESC
  1315. key provides a means for entering
  1316. .IR se 's
  1317. control characters literally as text into the file.  In fact,
  1318. any character that can be generated from the keyboard is
  1319. taken literally when it immediately follows the
  1320. .SM ESC
  1321. key.
  1322. If the character is non-printing (as are all of
  1323. .IR se 's
  1324. control characters),
  1325. it appears on the screen as the current non-printing replacement character
  1326. (normally a blank \(em see the options command \*(lqou\*(rq).
  1327. .SS Windowing Systems
  1328. On 4.3 `BSD', and on the AT&T Unix/PC or 3B1,
  1329. .I se
  1330. notices when its current window changes size or is repositioned,
  1331. and adjusts the screen image accordingly.
  1332. .SH FILES
  1333. .TP
  1334. .B $HOME/.serc
  1335. .I se
  1336. initialization file.
  1337. .TP
  1338. .BI /usr/tmp/ "process id" . sequence_number
  1339. for scratch file.
  1340. .TP
  1341. .B ./se.hangup
  1342. where
  1343. .I se
  1344. dumps its buffer if it catches a hang-up signal.
  1345. .TP
  1346. .B /usr/local/lib/se_h/*
  1347. help scripts for the \*(lqh\*(rq command.
  1348. .SH DIAGNOSTICS
  1349. Self explanatory diagnostics appear in the status line.
  1350. .SH CAVEATS
  1351. .I Se
  1352. will
  1353. .I never
  1354. dump its buffer into an encrypted file when it
  1355. encounters a hang-up,
  1356. even if encryption was turned on at the time.
  1357. .SH SEE ALSO
  1358. .I
  1359. Software Tools,
  1360. .I
  1361. Software Tools in Pascal,
  1362. .I
  1363. Software Tools Subsystem User's Guide,
  1364. ifelse(BSD,YES,.IR csh (1)`,',)
  1365. .IR ed (1),
  1366. .IR crypt (1),
  1367. .IR ksh (1),
  1368. .IR scriptse (1),
  1369. .IR sh (1),
  1370. .IR vi (1),
  1371. .IR signal (2),
  1372. ifelse(HARD_TERMS,YES,`divert(-1)',)
  1373. .IR ifelse(S5R2,YES, curses (3X)`,', termlib (3)`,')
  1374. ifelse(HARD_TERMS,YES,divert,)
  1375. .IR ifelse(BSD,YES, tty (4)`,', termio (7)`,')
  1376. .IR environ (5),
  1377. ifelse(HARD_TERMS,YES,`divert(-1)',)
  1378. .IR ifelse(S5R2,YES, terminfo (4), termcap (5))
  1379. ifelse(HARD_TERMS,YES,divert,)
  1380. .SH BUGS
  1381. Can only be run from a script if the script is first passed through
  1382. .IR scriptse (1).
  1383. .PP
  1384. Tabs could be handled better.  This is because
  1385. .I se
  1386. was originally written for Prime computers.
  1387. .PP
  1388. Does not check whether or not it has been put into the background
  1389. (this is to allow
  1390. .I se
  1391. to be used with the
  1392. .SM USENET
  1393. news software, which does a poor job
  1394. of signal handling for child processes).
  1395. .PP
  1396. Occasionally flakes out the screen when doing line inserts and deletes,
  1397. due to problems within the
  1398. .IR ifelse(S5R2,YES, curses (3X), termlib (3))
  1399. package in putting out the right number of padding characters.
  1400. Type a
  1401. control-]
  1402. to redraw the screen.
  1403. .PP
  1404. The auto\-indent feature does not recognize a line consisting
  1405. of just blanks and then a \*(lq.\*(rq to terminate input,
  1406. when the \*(lq.\*(rq is
  1407. not in the same position as the first non-blank character of the
  1408. previous line.
  1409. ifelse(S5R2,YES,
  1410. .PP
  1411. .I Se
  1412. does not work too well together with the
  1413. .IR shl (1)
  1414. utility`,' since if the user types a control-z`,' both of the programs
  1415. will see it`,' and
  1416. .I shl
  1417. will stop
  1418. .IR se `,'
  1419. while
  1420. .I se
  1421. will toggle the case of its input.
  1422. )
  1423. .PP
  1424. There is no global undo capability.
  1425. .PP
  1426. The help screens could use a rewrite.
  1427. .SH AUTHORS
  1428. .I Se
  1429. started out as the version of
  1430. .I ed
  1431. that came with the book \*(lqSoftware Tools,\*(rq
  1432. by Kernighan and Plauger, which was written in Ratfor. On the Pr1me
  1433. computers at the School of Information and Computer Science at Georgia Tech,
  1434. Dan Forsyth, Perry Flinn, and Alan Akin added all the enhancements suggested
  1435. in the exercises in the book, and some more of their own. Jack Waugh made
  1436. extensive modifications to turn the line editor into a screen editor;
  1437. further work was done by Dan Forsyth.
  1438. All of this was in an improved Georgia Tech version of Ratfor.
  1439. .PP
  1440. Later, Dan Forsyth, then (and now) at Medical Systems Development
  1441. Corporation, converted the Ratfor version into C, for Berkeley Unix (4.1 `BSD').
  1442. At Georgia Tech, Arnold Robbins took the C version and added many new features
  1443. and improvements, the most important of which was termlib support and System V
  1444. support. The existing help screens were edited and completed at that time, as
  1445. well. This was finished in early 1985.
  1446. .PP
  1447. Arnold Robbins is now at ...!emory!arnold, and will make every
  1448. reasonable attempt to answer any questions anyone may have about
  1449. .IR se ,
  1450. but in no way promises to support or enhance it.
  1451. SHAR_EOF
  1452. fi # end of overwriting check
  1453. #    End of shell archive
  1454. exit 0
  1455.  
  1456.